import React from 'react'
import { NavBar, Cell } from 'react-vant';
import { useNavigate, } from 'react-router-dom'

type Props = {}

export default function Mine(props: Props) {
    const navigate = useNavigate()
    // 点击退出
    const onClickRight = () => {
        // localStorage.removeItem('token') //清除token和userid
        // localStorage.removeItem('usesrid')
        localStorage.clear() //直接清除本地存储的全部数据
        navigate('/home')
    }
    return (
        <div>
            <NavBar
                title="个人中心"
                leftText="返回"
                rightText="退出"
                onClickLeft={() => navigate(-1)}
                onClickRight={onClickRight}
            />
            <Cell.Group title='个人中心' card >
                <Cell title='地址管理' isLink onClick={() => { navigate('/address') }} />
                <Cell title='订单中心' isLink onClick={() => { navigate('/order') }} />
            </Cell.Group>
        </div>
    )
}